<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>
        // function sayHi(name="张三"){
        //     console.log("你好 "+name);
            
        // }
        // sayHi("李四",20)
        // sayHi()


        // function sayHi(user){
        //     console.log("你好 "+user.name+" age = "+user.age);
            
        // }


        function sayHi( { name,age=20 }){
            console.log("你好 "+name+" age = "+age);
            
        }

        // sayHi(
        //     {
        //         name:'刘备',age:28
        //     }
        // )


        sayHi(
            {
                name:'刘备'
            }
        )

    



    </script>
    
</body>
</html>